package com.dianping.cat.home.router.entity;

import com.dianping.cat.home.router.BaseEntity;
import com.dianping.cat.home.router.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;





public class ServerGroup
  extends BaseEntity<ServerGroup>
{
  private String m_id;
  private String m_title;
/*  17 */   private Map<String, GroupServer> m_groupServers = new LinkedHashMap();





/*  23 */   public ServerGroup(String id) { this.m_id = id; }




/*  28 */   public void accept(IVisitor visitor) { visitor.visitServerGroup(this); }


  public ServerGroup addGroupServer(GroupServer groupServer) {
    this.m_groupServers.put(groupServer.getId(), groupServer);
/*  33 */     return this;
  }


  public boolean equals(Object obj) {
/*  38 */     if (obj instanceof ServerGroup) {
/*  39 */       ServerGroup _o = (ServerGroup)obj;

/*  41 */       if (!equals(getId(), _o.getId())) {
/*  42 */         return false;
      }

/*  45 */       return true;
    }

/*  48 */     return false;
  }


/*  52 */   public GroupServer findGroupServer(String id) { return (GroupServer)this.m_groupServers.get(id); }


  public GroupServer findOrCreateGroupServer(String id) {
/*  56 */     GroupServer groupServer = (GroupServer)this.m_groupServers.get(id);

/*  58 */     if (groupServer == null) {
/*  59 */       synchronized (this.m_groupServers) {
/*  60 */         groupServer = (GroupServer)this.m_groupServers.get(id);

/*  62 */         if (groupServer == null) {
/*  63 */           groupServer = new GroupServer(id);
/*  64 */           this.m_groupServers.put(id, groupServer);
        }
      }
    }

/*  69 */     return groupServer;
  }


/*  73 */   public Map<String, GroupServer> getGroupServers() { return this.m_groupServers; }



/*  77 */   public String getId() { return this.m_id; }



/*  81 */   public String getTitle() { return this.m_title; }



  public int hashCode() {
/*  86 */     int hash = 0;

/*  88 */     return hash * 31 + ((this.m_id == null) ? 0 : this.m_id.hashCode());
  }




  public void mergeAttributes(ServerGroup other) {
    assertAttributeEquals(other, "server-group", "id", this.m_id, other.getId());

/*  97 */     if (other.getTitle() != null) {
/*  98 */       this.m_title = other.getTitle();
    }
  }


/* 103 */   public GroupServer removeGroupServer(String id) { return (GroupServer)this.m_groupServers.remove(id); }


  public ServerGroup setId(String id) {
/* 107 */     this.m_id = id;
/* 108 */     return this;
  }

  public ServerGroup setTitle(String title) {
/* 112 */     this.m_title = title;
/* 113 */     return this;
  }

  public ServerGroup() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/classes/!/com/dianping/cat/home/router/entity/ServerGroup.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */